/**
 * @Title: PointRecordDao
 * @Package cn.com.yiqi.wsc.dao.point
 * @Description: TODO
 * Copyright: Copyright (c) 2016
 * Company: 成都壹柒互动科技有限公司
 * @author 会员系统组-胥钰淋
 * @date 2017/2/9 17:24
 * @version V1.0
 */
package cn.com.yiqi.wsc.dao.point;

import cn.com.artemis.framework.base.commons.persistence.CrudDao;
import cn.com.yiqi.wsc.Ro.PointDetailVO;
import cn.com.yiqi.wsc.Ro.PortalPointVO;
import cn.com.yiqi.wsc.dao.point.criteria.PointCriteria;
import cn.com.yiqi.wsc.dao.point.entity.PointRecordEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @author 会员系统组-胥钰淋
 * @ClassName: PointRecordDao
 * @Description: TODO
 * @date 2017/2/9 17:24
 */
@Repository
public interface PointRecordDao extends CrudDao<PointRecordEntity> {

    List<PointRecordEntity> selectList(
            @Param("customerId") Long customerId, @Param("bizType") Integer bizType,
            @Param("status") Integer status, @Param("invalidTime") Date invalidTime,
            @Param("bizTypeList") List<Integer> bizTypeList);

    int updateCancelUsedPoint(@Param("cancelPoint") int cancelPoint, @Param("id") long id);

    Long countPoint(@Param("customerId") long customerId, @Param("bizType") int value);

    Long sumExchangePoint(@Param("customerId") Long customerId, @Param("from") Date from, @Param("to") Date to, @Param("type") Integer type);

    Long countExchangePoint(@Param("customerId") Long customerId, @Param("from") Date from, @Param("to") Date to, @Param("type") Integer type);

    List<PointDetailVO> selectPointDetail(PointCriteria pointCriteria);


    /**
     * 分页查询
     *
     * @param criteria
     * @return
     */
    List<PortalPointVO> pageList(PointCriteria criteria);

    Long getSendTotal(PointCriteria criteria);

    Long getUsedTotal(PointCriteria criteria);


}
